<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Title</title>
    <script src="../vueJS/VUE.js"></script>
</head>

<body>
    <div id="root">
        <school></school>
    </div> 
    <script type="text/javascript">
    Vue.config.productionTip = false
    const name = Vue.extend({
        data(){
            return {name:'lzt'}
        },
        //需要写组建的结构
        template:`
        <div>
            <h2>名称{{name}}</h2>
        </div>
                    `
    })
    const school = Vue.extend({//this指向组件
        data(){
            return{
                schoolName:'HFUT'
            }
        },
        template:`
        <div>
            <h2>学校名称{{schoolName}}</h2> 
            <name></name>                                                                             
        </div>
                    `,
        components:{
            name
        }
    })
    new Vue({
        el:'#root',
        data:{},
        components:{//实际会用app组件来组装所有的组件，然后放在vm中
            school
        }
    })
    </script>
</body>
</html>